package com.wangs.entity;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

@Data
public class Order {

    @NotBlank(message = "订单号不能为空")
    private String orderNumber;

    @NotNull(message = "用户信息不能为空")
    @Valid // 关键点：在这里添加@Valid注解
    private User user;
}
